package jvm;

/**
 * @author wanyuxiang
 * @version 1.0
 * @project Java_base
 * @create 2017-05-05 14:59
 * @desc VM Args: -verbose:gc -XX:+PrintGCDetails
 **/
public class ReferenceCountingGC {
    private static final int _1MB = 1024 * 1024;
    public Object instance = null;
    private byte[] bigsize = new byte[2 * _1MB];

    public static void main(String[] args) {
        ReferenceCountingGC objA = new ReferenceCountingGC();
        ReferenceCountingGC objB = new ReferenceCountingGC();
        objA.instance = objB;
        objB.instance = objA;
        objA = null;
        objB = null;
        System.gc();
    }
}
